home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 API Bible / Windows 95 API Bible 3 Disc Set.iso / Win32 API Bible Book 1 of 3.iso / chapte25 / ex13.c < prev    next >
C/C++ Source or Header  |  1995-04-23  |  1KB  |  33 lines

  1. #include <genstub.c>
  2.  
  3. LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  4. {
  5.    switch (uMsg)
  6.    {
  7.       case WM_COMMAND:
  8.          switch (wParam)
  9.          {
  10.              case IDM_TEST:
  11.              {
  12.                 CONTEXT context;
  13.                 TCHAR szBuffer[128];
  14.                 context.ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
  15.                 GetThreadContext( GetCurrentThread(), &context );
  16.                 wsprintf( szBuffer, "CS=%X, EIP=%X, FLAGS=%X, DR1=%X",
  17.                           context.SegCs, context.Eip, context.EFlags, context.Dr1 );
  18.                 MessageBox( hWnd, szBuffer, "Selected Values of Thread Context", MB_OK );
  19.              }
  20.              break;
  21.              case IDM_EXIT:
  22.                  DestroyWindow(hWnd);
  23.              break;
  24.          }
  25.       break;
  26.       case WM_DESTROY:
  27.          PostQuitMessage(0);
  28.       break;
  29.       default:
  30.           return (DefWindowProc(hWnd, uMsg, wParam, lParam));
  31.    }
  32.    return (NULL);
  33. }